<template>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in lists" :key="item.id" @click="goDetail(item.id)">
        <img :src="item.image" alt="轮播图" style="width:100%;height:100%" />
      </van-swipe-item>
    </van-swipe>
</template>

<script>
  export default {
    name:'swiper',
    props: {
      lists: {
        type: Array,
        default: () =>{}
      },
    },
    methods: {
      goDetail(id) {
        this.$router.push({
          path:'/details',
          query:{id}
        })
      }
    },
  }
</script>

<style lang="scss" scoped>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  height: 180px;
  line-height: 180px;
  text-align: center;
  background-color: #39a9ed;
}
</style>